package sample.chapter7.generic;

import java.util.ArrayList;
import java.util.List;

/**
 * Creating your own generic class
 * 
 * @author kan.sun
 */
public class TestRental
{
	public static void main(String[] args)
	{
		Car c1 = new Car();
		Car c2 = new Car();
		List<Car> carList = new ArrayList<Car>();
		carList.add(c1);
		carList.add(c2);
		RentalGeneric<Car> carRental = new RentalGeneric<Car>(2, carList);
		
		Car carToRent = carRental.getRental();
		carRental.returnRental(carToRent);
		
		System.out.println(carRental.getRentalPool().size());
		for (Car car:carRental.getRentalPool())
			System.out.println(car);
	}
}
